#@note   Hikvision Digital Technology Co., Ltd. All Rights Reserved.
#@brief  CMake子目录配置文件
#@author Yaopei
#@date   2015/7/31
#@note   the CMakeLists.txt for src. directory


PROJECT(HMSProxy)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -g -O2 -Wall")

if(COMMAND cmake_policy)
    cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)

INCLUDE_DIRECTORIES(
  ${PROJECT_SOURCE_DIR}/../../publiclib/
  ${PROJECT_SOURCE_DIR}/../../publiclib/traceworker
  ${PROJECT_SOURCE_DIR}/../../publiclib/simple-ini
  ${PROJECT_SOURCE_DIR}/../../publiclib/httpclient
  ${PROJECT_SOURCE_DIR}/../../publiclib/map-algor
  ${PROJECT_SOURCE_DIR}/../../publiclib/iwechen-thrift
  ${PROJECT_SOURCE_DIR}/../../publiclib/tinyxml2pp
  ${PROJECT_SOURCE_DIR}/../../publiclib/iwechen-thrift/gen-cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/redis-pubsub/pubsub
  ${PROJECT_SOURCE_DIR}/../../publiclib/json-helper
  /usr/include/mysql/
  /usr/local/include/hiredis-vip/
  /home/huangyuan/code/rapidjson/include/
)
LINK_DIRECTORIES(
  ${PROJECT_SOURCE_DIR}/lib
  ${PROJECT_SOURCE_DIR}/event/lib
  /usr/lib64/mysql
)


SET(SRC_SRCS
  ${PROJECT_SOURCE_DIR}/../../publiclib/iwechen-thrift/gen-cpp/Serv.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/iwechen-thrift/gen-cpp/server_constants.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/iwechen-thrift/gen-cpp/server_types.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/iwechen-thrift/ClientManager.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/iwechen-thrift/ServerManager.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/iwechen-thrift/ServClient.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/iwechen-thrift/Base64.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/iwechen-thrift/ImgUrl.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/iwechen-thrift/String.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/iwechen-thrift/Random.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/iwechen-thrift/Md5.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/iwechen-thrift/ThriftClient.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/json-helper/JsonHelper.cpp

  ${PROJECT_SOURCE_DIR}/../../publiclib/traceworker/trace_worker.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/traceworker/trace_base.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/traceworker/time_calc.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/traceworker/platform_base.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/traceworker/mem_calc.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/traceworker/log_opr.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/traceworker/locale_file.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/traceworker/link_tool.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/traceworker/IFile.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/traceworker/file_manager.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/conn-pool/ConnPool.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/simple-ini/ConvertUTF.c
  ${PROJECT_SOURCE_DIR}/../../publiclib/redis-pubsub/pubsub/redis_publisher.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/httpclient/httpclient.cpp
  ${PROJECT_SOURCE_DIR}/../../publiclib/tinyxml2pp/tinyxml2.cpp

  Serv_server.skeleton.cpp
  CosServer.cpp
  CosDb.cpp
)

# shared library
#ADD_LIBRARY(BigdataStreamRecv SHARED ${SRC_SRCS} )

#static library
#ADD_LIBRARY(BigdataStreamRecv_static STATIC ${SRC_SRCS})

ADD_EXECUTABLE(cos-server ${SRC_SRCS})
# link library
TARGET_LINK_LIBRARIES(cos-server thrift thriftnb event curl json z
                      boost_system boost_thread boost_date_time
                      mysqlpp mysqlclient hiredis_vip)

# clean
#SET_TARGET_PROPERTIES(BigdataStreamRecv PROPERTIES CLEAN_DIRECT_OUTPUT 1)
#SET_TARGET_PROPERTIES(BigdataStreamRecv_static PROPERTIES CLEAN_DIRECT_OUTPUT 1)

